'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.bulkInsert('categories', [
      // 主分类
      {
        id: 1,
        name: '上装',
        name_en: 'tops',
        parent_id: null,
        level: 1,
        sort_order: 1,
        description: '上身穿着的衣物',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 2,
        name: '下装',
        name_en: 'bottoms',
        parent_id: null,
        level: 1,
        sort_order: 2,
        description: '下身穿着的衣物',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 3,
        name: '外套',
        name_en: 'outerwear',
        parent_id: null,
        level: 1,
        sort_order: 3,
        description: '外穿的衣物',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 4,
        name: '鞋子',
        name_en: 'shoes',
        parent_id: null,
        level: 1,
        sort_order: 4,
        description: '脚部穿着的鞋类',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 5,
        name: '配饰',
        name_en: 'accessories',
        parent_id: null,
        level: 1,
        sort_order: 5,
        description: '装饰性配件',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      
      // 上装子分类
      {
        id: 11,
        name: 'T恤',
        name_en: 't-shirt',
        parent_id: 1,
        level: 2,
        sort_order: 1,
        description: '短袖T恤',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 12,
        name: '衬衫',
        name_en: 'shirt',
        parent_id: 1,
        level: 2,
        sort_order: 2,
        description: '正式衬衫',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 13,
        name: '毛衣',
        name_en: 'sweater',
        parent_id: 1,
        level: 2,
        sort_order: 3,
        description: '针织毛衣',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 14,
        name: '背心',
        name_en: 'vest',
        parent_id: 1,
        level: 2,
        sort_order: 4,
        description: '无袖背心',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      
      // 下装子分类
      {
        id: 21,
        name: '牛仔裤',
        name_en: 'jeans',
        parent_id: 2,
        level: 2,
        sort_order: 1,
        description: '牛仔面料裤子',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 22,
        name: '休闲裤',
        name_en: 'casual-pants',
        parent_id: 2,
        level: 2,
        sort_order: 2,
        description: '休闲长裤',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 23,
        name: '短裤',
        name_en: 'shorts',
        parent_id: 2,
        level: 2,
        sort_order: 3,
        description: '短裤',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 24,
        name: '裙子',
        name_en: 'skirt',
        parent_id: 2,
        level: 2,
        sort_order: 4,
        description: '各类裙装',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      
      // 外套子分类
      {
        id: 31,
        name: '夹克',
        name_en: 'jacket',
        parent_id: 3,
        level: 2,
        sort_order: 1,
        description: '轻薄外套',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 32,
        name: '大衣',
        name_en: 'coat',
        parent_id: 3,
        level: 2,
        sort_order: 2,
        description: '厚重大衣',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 33,
        name: '羽绒服',
        name_en: 'down-jacket',
        parent_id: 3,
        level: 2,
        sort_order: 3,
        description: '保暖羽绒服',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      
      // 鞋子子分类
      {
        id: 41,
        name: '运动鞋',
        name_en: 'sneakers',
        parent_id: 4,
        level: 2,
        sort_order: 1,
        description: '运动休闲鞋',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 42,
        name: '皮鞋',
        name_en: 'leather-shoes',
        parent_id: 4,
        level: 2,
        sort_order: 2,
        description: '正式皮鞋',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 43,
        name: '靴子',
        name_en: 'boots',
        parent_id: 4,
        level: 2,
        sort_order: 3,
        description: '各类靴子',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      
      // 配饰子分类
      {
        id: 51,
        name: '帽子',
        name_en: 'hat',
        parent_id: 5,
        level: 2,
        sort_order: 1,
        description: '各类帽子',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 52,
        name: '包包',
        name_en: 'bag',
        parent_id: 5,
        level: 2,
        sort_order: 2,
        description: '各类包包',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        id: 53,
        name: '首饰',
        name_en: 'jewelry',
        parent_id: 5,
        level: 2,
        sort_order: 3,
        description: '首饰配件',
        is_active: true,
        created_at: new Date(),
        updated_at: new Date(),
      },
    ]);
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('categories', null, {});
  },
};
